home *** CD-ROM | disk | FTP | other *** search
/ The X-Philes (2nd Revision) / The X-Philes Number 1 (1995).iso / xphiles / hp48_1 / stat.var < prev    next >
Text File  |  1995-03-23  |  2KB  |  71 lines

  1. Subject: Emphirical stocastic distribution of one variable
  2.  
  3. This is a set of programs to compute several information about
  4. empirical stocastic distribution of one variable.
  5. All programs work on a SigmaDAT which you may enter before
  6. any calculation. Each value in SigmaDAT is intended as a single
  7. value of empirical distribution and not a frequency of it.
  8. If you want this program running with empirical frequency
  9. distribution you must delete in each one program " N\GS / ".
  10. Strp comments and cut here above.
  11. ------------------------------------------------------------------
  12. %%HP: T(3)A(D)F(.);
  13.     DIR
  14.       @ You must enter SigmaDAT before calculation.
  15.       \GSDAT 0
  16.       KMO
  17.       @ Computes the k-th moment about the origin. 
  18.         \<< \-> k
  19.           \<< \GSDAT OBJ\-> DROP k ^ 1 N\GS 1 -
  20.             START SWAP k ^ +
  21.             NEXT N\GS /
  22.           \>>
  23.         \>>
  24.       KMM
  25.       @ Computes the k-th moment about the mean.
  26.         \<< \-> k
  27.           \<< \GSDAT OBJ\-> DROP MEAN - k ^ 1 N\GS 1 -
  28.             START SWAP MEAN - k ^ +
  29.             NEXT N\GS /
  30.           \>>
  31.         \>>
  32.       @ Computes the standard deviation. 
  33.       Sdev
  34.         \<< 2 KMM \v/ \>>
  35.       @ Computes the Skewness index.
  36.       SKEW
  37.         \<< 3 KMM Sdev 3 ^ /
  38.           "\Gmc\179=E{X\179}+2\Gm\179-3\GmE{X\178}"
  39.           \->TAG
  40.         \>>
  41.       @ Computes the Curtosi index.
  42.       CURT
  43.         \<< 4 KMM 2 KMM SQ / \>>
  44.       @ For a given class number computes the frequencies for
  45.       @ each class boundary. As min value for BINS use MINSigma
  46.       @ and as value for boundary range use 
  47.       @ (MAXSigma-MINSigma)/(Number of class).
  48.       NCLASS
  49.         \<< \-> CL
  50.           \<< MAX\GS MIN\GS - CL / \-> DCL
  51.             \<< MIN\GS DCL CL BINS DROP
  52.               ARRY\-> DROP { 1 CL } \->ARRY DUP DUP SIZE
  53.               N\GS CON ADIVB { \GSPAR } PURGE
  54.             \>>
  55.           \>>
  56.         \>>
  57.       @ Divide each element of an array a for each element of a
  58.       @ same dimension array b. (Used from NCLASS)
  59.       ADIVB
  60.         \<< \-> TMP
  61.           \<< ARRY\-> LIST\-> DROP \-> I
  62.             \<< I
  63.               FOR K I ROLL TMP { 1 K } GET /
  64.               NEXT { 1 I } \->ARRY
  65.             \>>
  66.           \>>
  67.         \>>
  68.     END
  69. ------------------------------------------------------------------
  70. Luca Radice Politecnico di Milano ele9050@cdc835.cdc.polimi.it
  71.